import 'package:flutter/material.dart';
import 'package:hellow01/modules/music/music_detail_page.dart';
import 'Constants/constants.dart' show AppColors;
import 'modules/login_module/login_page.dart';
import 'modules/home/home_page.dart';
import 'modules/me_module/setting_page.dart';
import 'modules/music/music_list.dart';
import 'tools/physical_handle/android_back_desktop.dart';

void main() => runApp(new MyApp());

/* 创建一个无状态的 Widget */
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {



    // 创建一个 material 风格的 app
    return new MaterialApp(
      debugShowMaterialGrid:false,
      title: 'Demo', // 设置 App 的标题
      theme: new ThemeData.light().copyWith(
        primaryColor: Color(AppColors.AppBarColor),
        cardColor: Color(AppColors.AppBarColor)
      ), // 设置主题颜色11
    
      //home: LoginPage(),
      home: WillPopScope(
				onWillPop: () async {
					AndroidBackTop.backDeskTop();  //设置为返回不退出app
					return false;  //一定要return false
				},
				child:LoginPage(),
			),


      routes: <String,WidgetBuilder>{
        '/loginPage':(BuildContext cxt)=> LoginPage(),
        '/homePage':(BuildContext cxt)=> HomePage(),
        '/settingPage':(BuildContext cxt)=> SettingPage(),
        '/musicPage':(BuildContext cxt)=> MusicListPage(),
        //'/musicDetailPage':(BuildContext cxt)=> MusicDetailPage(),
      },


    );
  }
}


//路由 https://www.cnblogs.com/wf-l5201314/p/10796495.html
